MAIN = main
SRCPATH = ./src/
GLTOOLS = ./GLTools/src/
LIBDIRS = -L/usr/local/freeglut/lib -L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -L/usr/lib
INCDIRS = -I/usr/include -I/usr/local/include -I/usr/include/GL -I./GLTools/include/  -I./GLTools/include/GL -I/usr/local/freeglut/include

CC = g++
CXX = g++
CFLAGS = $(COMPILERFLAGS) -g $(INCDIRS)
CXXFLAGS = $(CFLAGS)
LIBS = -lX11 -lglut -lGL -lGLU -lm -lpng

all: prog
prog : $(MAIN)

$(MAIN).o  		: $(SRCPATH)$(MAIN).cpp
flocking.o		: $(SRCPATH)flocking.cpp
fireworks.o		: $(SRCPATH)fireworks.cpp
gravity.o		: $(SRCPATH)gravity.cpp
glUtils.o		: $(SRCPATH)glUtils.cpp
utils.o			: $(SRCPATH)utils.cpp
controller.o		: $(SRCPATH)controller.cpp
glew.o    		: $(GLTOOLS)glew.c
GLTools.o    		: $(GLTOOLS)GLTools.cpp
GLBatch.o    		: $(GLTOOLS)GLBatch.cpp
GLTriangleBatch.o    	: $(GLTOOLS)GLTriangleBatch.cpp
GLShaderManager.o    	: $(GLTOOLS)GLShaderManager.cpp
math3d.o    		: $(GLTOOLS)math3d.cpp

$(MAIN) : $(MAIN).o flocking.o glew.o
	$(CC) $(CFLAGS) -o $(MAIN) $(LIBDIRS) $(SRCPATH)$(MAIN).cpp $(SRCPATH)flocking.cpp $(SRCPATH)fireworks.cpp $(SRCPATH)gravity.cpp $(SRCPATH)glUtils.cpp $(SRCPATH)utils.cpp $(SRCPATH)controller.cpp $(GLTOOLS)glew.c $(GLTOOLS)GLTools.cpp $(GLTOOLS)GLBatch.cpp $(GLTOOLS)GLTriangleBatch.cpp $(GLTOOLS)GLShaderManager.cpp $(GLTOOLS)math3d.cpp $(LIBS)

clean:
	rm -f *.o *~ main src/*~ src/shaders/*~
